<?php
registerTable("question_all_question", new table_question_all_question());

class table_question_all_question extends Database
{

    public function __construct()
    {
        parent::__construct("question_all_question");
    }

    public function fetch_by_questionid($qid)
    {
        return $this->fetch_assoc("`questionid`=$qid");
    }

    public function fetch_question_by_label_search($keyword, $index, $amount)
    {
        return  $this->fetch_all_assoc_by_sql("SELECT * FROM `question_all_question` WHERE concat(`label`) like '%$keyword%' LIMIT $index,$amount;");
    }

    public function fetch_question_by_description_search($keyword, $index, $amount)
    {
        return  $this->fetch_all_assoc_by_sql("SELECT * FROM `question_all_question` WHERE concat(`description`) like '%$keyword%' LIMIT $index,$amount;");
    }
    public function fetch_question_by_search($where, $index, $amount)
    {
        return $this->fetch_all_assoc_by_sql("SELECT * FROM `question_all_question` WHERE $where LIMIT $index,$amount;");
    }
    
    
}
?>